package org.xdq.demo.user.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.xdq.demo.user.dto.UserDto;
import org.xdq.demo.user.model.User;

@Mapper
public interface UserDao {

    @Select("select count(u_id) from t_user where u_id = #{u_id}")
    boolean findIsExistsUser(String u_id);

    @Insert("insert into t_user(u_id,u_name,u_pwd) values(#{u_id},#{u_name},#{u_pwd})")
    void insertUser(UserDto userDto);

    @Select("select u_id,u_name from t_user where u_id = #{u_id} and u_pwd = #{u_pwd}")
    User findUserByUserIdAndPwd(UserDto userDto);
}
